home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_313 / uucp / uucp1.lzh / src / lib / string.c < prev    next >
C/C++ Source or Header  |  1990-01-10  |  589b  |  44 lines

  1.  
  2. /*
  3.  *  STRING.C
  4.  *
  5.  *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  6.  *
  7.  */
  8.  
  9. strcmpi(s, d)
  10. char *s;
  11. char *d;
  12. {
  13.     short c1, c2;
  14.     for (;;) {
  15.     c1 = *s++;
  16.     c2 = *d++;
  17.  
  18.     if (c1 == 0 || c2 == 0)
  19.         return(c1 || c2);   /*  0= both are 0   */
  20.     if (((c1 ^ c2) | 0x20) != 0x20)
  21.         return(1);
  22.     }
  23.     return(0);
  24. }
  25.  
  26. strncmpi(s, d, n)
  27. char *s;
  28. char *d;
  29. short n;
  30. {
  31.     short c1, c2;
  32.     while (n--) {
  33.     c1 = *s++;
  34.     c2 = *d++;
  35.  
  36.     if (c1 == 0 || c2 == 0)
  37.         return(c1 || c2);   /*  0= both are 0   */
  38.     if (((c1 ^ c2) | 0x20) != 0x20)
  39.         return(1);
  40.     }
  41.     return(0);
  42. }
  43.  
  44.